<?php

namespace catchAdmin\externalGoods\event;

use catchAdmin\externalGoods\model\CainiaoNotify;
use catchAdmin\permissions\model\Permissions;
use catcher\CatchAdmin;
use think\facade\Db;

class CainiaoNotifyEvent
{
    public function handle($params)
    {
        app(CainiaoNotify::class)->storeBy([
            'logistics_interface' => $params['logistics_interface'] ?? json_encode([]),
            'data_digest' => $params['data_digest']  ?? '',
            'partner_code' => $params['partner_code']  ?? '',
            'from_code' => $params['from_code']  ?? '',
            'msg_type' => $params['msg_type']  ?? '',
            'msg_id' => $params['msg_id']  ?? '',
            'created_at' => time(),
        ]);
    }
}
